package com.ai.front.server;

import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.webapp.WebAppContext;

/**
 * jetty
 * Created by renbangjie on 16/6/23.
 */
public class JettyFront {

    private static Server server = new Server();

    public static void main(String[] args) throws Exception{

        Connector connector = new SelectChannelConnector();
        connector.setPort(9696);
        server.addConnector(connector);

        WebAppContext context = new WebAppContext("src/main/webapp", "/");

        server.setHandler(context);

        server.setStopAtShutdown(true);
        server.setSendServerVersion(true);

        server.start();
        server.join();
    }

}
